#pragma once
#include "common_tool/factory.h"
#include "vehicle_lmpc_base.hpp"
#include "vehicle_lateral_speed3dis_mpc.h"
#include "vehicle_lateral_speed_mpc.h"
#include "vehicle_lateral_speed_yaw_mpc.h"
#include "vehicle_ll_mpc.h"
#include "vehicle_ll_4d4s_mpc.h"
#include "vehicle_vy_yaw_error3dis_mpc.h"

namespace auto_ros
{
namespace control
{
template <class derived>
VehicleLMpcBase *createLMpcDerived(const std::string dyn_mpc_kf_config_path_name, const std::string vehicle_lmpc_yaml_name, double rate)
{
	return new derived(dyn_mpc_kf_config_path_name, vehicle_lmpc_yaml_name, rate);
}
using vehicle_lmpc_factory_type =
	auto_ros::common_tool::Factory<std::string, VehicleLMpcBase, VehicleLMpcBase *(*)(const std::string dyn_mpc_kf_config_path_name, const std::string vehicle_lmpc_yaml_name, double rate)>;
class VehicleLMpcFactory : public vehicle_lmpc_factory_type
{
private:
	/* data */
public:
	VehicleLMpcFactory()
	{
		//Register("KfLateral", createKfDerived<KfLateral>);
		Register("VehicleLateralSpeed3disMpc", createLMpcDerived<VehicleLateralSpeed3disMpc>);
		Register("VehicleLateralSpeedMpc", createLMpcDerived<VehicleLateralSpeedMpc>);
		Register("VehicleLateralSpeedYawMpc", createLMpcDerived<VehicleLateralSpeedYawMpc>);
		Register("VehicleLLMpc", createLMpcDerived<VehicleLLMpc>);
		Register("VehicleLL4d4sMpc", createLMpcDerived<VehicleLL4d4sMpc>);
		Register("VehicleVyYawError3disMpc", createLMpcDerived<VehicleVyYawError3disMpc>);
	}
};
} // namespace control
} // namespace auto_ros
